package com.zoke.daycarpool.domain;

import com.zoke.daycarpool.config.CarpoolConfig;
import com.zoke.support.utils.PersistTool;

/**
 * 
 * @author Jack
 *
 */
public class Token {
	private Token() {
	}

	private static Token token = new Token();

	public static Token getTokener() {
		return token;
	}

	/** 获取Token **/
	public long getToken() {
		return PersistTool.getLong(CarpoolConfig.TOKEN, 0);
	}

	/** 更新Token **/
	public boolean updateToken(long token) {
		if (token < getToken())
			return false;// 不更新
		PersistTool.saveLong(CarpoolConfig.TOKEN, token);
		return true;
	}
}
